<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:php="http://php.net/xsl"
	version="1.0">

	<xsl:include href="../common/layout.xsl"/>
	<xsl:include href="../common/passport.xsl"/>
	<xsl:include href="../common/utils.xsl"/>

	<!-- XHTML Output -->
	<xsl:template match="//platcode">
		<html>
			<xsl:call-template name="header"/>
			<body>
				<xsl:call-template name="passport-logo"/>
				<div class="user-bar">
					<ul>
						<li>
							<a href="{$base-url}">
								<xsl:value-of select="php:function('lang','base_name')"/>
							</a>
						</li>
						<xsl:call-template name="session-bar"/>
					</ul>
				</div>
				<div id="form-account" class="normal-form">
					<form action="/account/edit/script" method="post" enctype="multipart/form-data" target="callback-target" onsubmit="return false">
						<h1>
							<xsl:value-of select="php:function('lang','account_update')"/>
						</h1>
						<p>
							<xsl:value-of select="php:function('lang','alert_private_zone')" disable-output-escaping="yes"/>
						</p>
						<xsl:apply-templates select="person"/>
					</form>
					<iframe id="callback-target" name="callback-target" style="display:none;"></iframe>
				</div>
			</body>
		</html>
	</xsl:template>

	<!-- Person information -->
	<xsl:template match="person">
		<ul>
			<li>
				<div>
					<label name="nickname">
						<xsl:value-of select="php:function('lang','nickname')"/>
					</label>
					<input type="text" id="nickname" name="nickname" maxlength="50" tabindex="1"/>
				</div>
			</li>
			<li>
				<div>
					<label name="fullname">
						<xsl:value-of select="php:function('lang','fullname')"/>
					</label>
					<input type="text" id="fullname" name="fullname" maxlength="150" tabindex="2"/>
					<em>
						<xsl:value-of select="php:function('lang','real_name')"/>
					</em>
				</div>
			</li>
			<li class="two-col">
				<div>
					<span>
						<div id=":userpic" class="t-center">
							<xsl:call-template name="view-userpic"/>
						</div>
					</span>
					<span class="right">
						<div>
							<label for="dob">
								<xsl:value-of select="php:function('lang','birthday')"/>
							</label>
							<input type="text" id="dob" name="dob" readonly="readonly" tabindex="3"/>
						</div>
						<div class="act-ctrl">
							<ul class="two-col">
								<li>
									<input type="radio" id="female" name="gender" value="F" tabindex="4"/>
									<label for="female">
										<xsl:value-of select="php:function('lang','female')"/>
									</label>
								</li>
								<li>
									<input type="radio" id="male" name="gender" value="M" tabindex="5"/>
									<label for="male">
										<xsl:value-of select="php:function('lang','male')"/>
									</label>
								</li>
							</ul>
						</div>
						<div class="p-relat t-center">
							<input type="hidden" name="callback" value="upic.process"/>
							<input type="file" class="file" name="userpic" onchange="upic.upload(this)"/>
							<div class="t-link">
								<xsl:value-of select="php:function('lang','click_to_upload')"/>
							</div>
							<div class="t-mini">
								<xsl:value-of select="php:function('lang','avatar_format')" disable-output-escaping="yes"/>
							</div>
						</div>
					</span>
				</div>
			</li>
			<li class="two-col">
				<div>
					<span>
						<label for="postcode">
							<xsl:value-of select="php:function('lang','postcode')"/>
						</label>
						<input type="text" id="postcode" name="postcode" tabindex="6"/>
					</span>
					<span class="right">
						<label for="lang">
							<xsl:value-of select="php:function('lang','language')"/>
						</label>
						<select id="lang" name="lang" tabindex="8">
							<xsl:call-template name="html-select">
								<xsl:with-param name="directory" select="//table-languages"/>
							</xsl:call-template>
						</select>
						<em>
							<xsl:value-of select="php:function('lang','native_lang')"/>
						</em>
					</span>
				</div>
			</li>
			<li>
				<div>
					<label for="country">
						<xsl:value-of select="php:function('lang','country')"/>
					</label>
					<select id="country" name="country" tabindex="7">
						<xsl:call-template name="html-select">
							<xsl:with-param name="directory" select="//table-countries"/>
						</xsl:call-template>
					</select>
				</div>
			</li>
			<li>
				<div>
					<label for="tz">
						<xsl:value-of select="php:function('lang','timezone')"/>
					</label>
					<input type="text" id="tz" name="timezone" tabindex="9" readonly="readonly"/>
				</div>
			</li>
			<li class="footer">
				<div class="right">
					<button type="submit" tabindex="10">
						<xsl:value-of select="php:function('lang','update')"/>
					</button>
				</div>
			</li>
		</ul>
	</xsl:template>

</xsl:stylesheet>
